import request from '@/utils/request';

interface IUser {
    username: string;
    password: string;
    nickName: string;
    state: number;
    id: number;
}
interface IE189Resp {
    appId: string;
    paras: string;
    sign: string;
}
/**
 * 用户登录接口
 */
export function userLogin(query: IUser): Promise<any> {
    return request({
        api: '/api/appActivity/login',
        query
    });
}

/**
 * 获取用户登录链接
 */
export function getUserLoginUrl(query:any): Promise<any> {
    return request({
        api: '/reward/authlpp/autoLoginUrlWap',
        query
    });
}

/**
 * 获取用户登录链接
 */
export function getUserToken(query:IE189Resp): Promise<any> {
    return request({
        api: '/reward/authlpp/getUserToken',
        query
    });
}

/**
 * 保存工具初始化数据
 */
export function saveConfig(query:any): Promise<any> {
    return request({
        api: '/reward/authlpp/saveToolConfig',
        method: 'POST',
        query
    });
}